<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=0.4"/>
<meta name="description" content="SLEEF implements vectorized C99 math functions." />
<meta name="google" content="notranslate" />
<link rel="canonical" href="https://sleef.org/" />
<link rel="icon" href="favicon.png" />
<link rel="stylesheet" type="text/css" href="texlike.css"/>
<link rel="stylesheet" type="text/css" href="sleef.css"/>
<title>SLEEF Vectorized Math Library</title>
</head>
<body translate="no" class="notranslate">
<h1>SLEEF Vectorized Math Library<img src="sleef2025.png" alt="logo" width="25%" height="25%" style="float: right" /></h1>

<ul class="none" style="font-family: arial, sansserif; margin-top: 1.0cm;">
  <li><a class="underlined" style="color:#a00000;" href="https://github.com/shibatch/sleef/releases">Download the latest version</a></li>
  <li><a class="underlined" href="https://sleef.org/">Latest documentation on the web</a></li>
  <li><a class="underlined" href="https://github.com/shibatch/sleef">GitHub repository</a></li>
  <li><a class="underlined" href="https://github.com/shibatch/sleef/discussions">Discussions</a></li>
  <li><a class="underlined" href="https://github.com/shibatch/sleef/wiki">Wiki pages</a></li>
</ul>

<h2>Table of contents</h2>

<ul class="none" style="font-family: arial, sansserif; padding-left: 0.5cm;">
  <li><a class="underlined" href="index.xhtml">Introduction</a>
    <ul class="disc">
      <li><a href="index.xhtml#overview">Overview</a></li>
      <li><a href="index.xhtml#environment">Supported environments</a></li>
      <li><a href="index.xhtml#credit">Credit</a></li>
      <li><a href="index.xhtml#license">License</a></li>
      <li><a href="index.xhtml#history">History</a></li>
      <li><a href="index.xhtml#related">Related projects</a></li>
      <li><a href="index.xhtml#publication">Publication</a></li>
    </ul>
  </li>
  <li>&nbsp;</li>
  <li><a class="underlined" href="compile.xhtml">Compiling and installing the library</a></li>
  <li><a class="underlined" href="purec.xhtml">Math library reference</a></li>
  <li><a class="underlined" href="quad.xhtml"> Quad-precision math library reference</a></li>
  <li><a class="underlined" href="dft.xhtml">DFT library reference</a></li>
  <li><a class="underlined" href="misc.xhtml">Other tools included in the package</a></li>
  <li><a class="underlined" href="benchmark.xhtml">Benchmark results</a></li>
  <li><a class="underlined" href="additional.xhtml">Additional notes</a></li>
</ul>

<h2 id="overview">Overview</h2>

<p class="noindent">
  SLEEF stands for SIMD Library for Evaluating Elementary
  Functions. It implements manually <a class="underlined"
  href="https://en.wikipedia.org/wiki/Automatic_vectorization">vectorized</a>
  versions of all C99 real floating point math functions. It can
  utilize SIMD instructions that are available on modern
  processors. SLEEF is designed to effciently perform computation with
  SIMD instructions by reducing the use of conditional branches and
  scatter/gather memory access. Our <a class="underlined"
  href="benchmark.xhtml">benchmarks</a> show that the performance of
  SLEEF is comparable to that of the best commercial library.
</p>

<p>
  Unlike closed-source commercial libraries, which are often
  assembly-optimized, SLEEF is designed to work with various
  architectures, operating systems and compilers. It is distributed
  under <a class="underlined"
  href="http://www.boost.org/users/license.html">the Boost Software
  License</a>, which is a permissive open source license. SLEEF can be
  easily ported to other architectures by writing a helper file, which
  is a thin abstraction layer of SIMD intrinsics. SLEEF also
  provides <a class="underlined"
  href="additional.xhtml#dispatcher">dispatchers</a> that
  automatically choose the best subroutines for the computer on which
  the library is executed. In order to further optimize the
  application code that calls SLEEF functions,
  <a class="underlined" href="additional.xhtml#lto">link time
  optimization(LTO)</a> can be used to reduce the overhead of
  functions calls, and the build system of SLEEF supports usage of
  LTO. The library also has a functionality to generate
  <a class="underlined" href="additional.xhtml#inline">header
  files</a> in which the library functions are all defined as inline
  functions. SLEEF can be used for <a class="underlined"
  href="cuda.xhtml">GPGPU</a> and <a class="underlined"
  href="additional.xhtml#wasm">WebAssembly</a> with these header
  files. In addition to the vectorized functions, SLEEF provides
  scalar functions. Calls to these scalar SLEEF functions can be
  <a class="underlined"
  href="additional.xhtml#vectorizing">auto-vectorized</a> by GCC and
  Clang. These functions return deterministic values across all
  architectures. That is, they are designed to return exactly the same
  value for the same argument even on different architectures.
</p>

<p>
  The library contains implementations of all C99 real FP math
  functions in double precision and single precision. Different
  accuracy of the results can be chosen for a subset of the elementary
  functions; for this subset there are versions with up to
  1 <a class="underlined" href="additional.xhtml#ulp">ULP</a> error
  (which is the maximum error, not the average) and even faster
  versions with a few ULPs of error bounds. For non-finite inputs and
  outputs, the functions return correct results as specified in the
  C99 standard. All the functions in the library
  are <a class="underlined" href="misc.xhtml#testerlibm">thoroughly
  tested</a> and confirmed that the evaluation error is within the
  designed limit by comparing the returned values against
  high-precision evaluation using the GNU MPFR Library.
</p>

<p>
  SLEEF also includes a <a class="underlined"
  href="quad.xhtml">quad-precision math library</a>. This library
  includes fully vectorized IEEE 754 quadruple-precision (QP)
  functions that correspond to the standard C math functions. I/O
  functions for converting between QP numbers and strings are also
  available.
</p>

<br/>

<p>
  SLEEF includes a library of <a class="underlined"
  href="dft.xhtml">discrete Fourier transform(DFT)</a>. It is fully
  vectorized, heavily unrolled, and parallelized in such a way that
  modern SIMD instructions and multiple cores can be utilized, and it
  can utilize long vectors up to 2048 bits. It has an API similar to
  that of FFTW for easy migration. The helper files for abstracting
  SIMD intrinsics are shared with SLEEF libm, and thus it is easy to
  port the DFT library to other architectures. <a class="underlined"
  href="benchmark.xhtml#dft">Benchmark results of the DFT library</a>
  are now available.
</p>

<h2 id="environment">Supported environments</h2>

<p class="noindent">
  This library supports the following architectures :
</p>

<div><br/></div>

<ul class="disc">
  <li><a class="underlined" href="x86.xhtml">x86</a> - SSE2, AVX2, AVX512F</li>
  <li>RISC-V - RVV1, RVV2</li>
  <li><a class="underlined" href="ppc64.xhtml">PowerPC64</a> - VSX (POWER8), VSX-3 (POWER9)</li>
  <li><a class="underlined" href="s390x.xhtml">System/390</a> - VXE (z14), VXE2 (z15)</li>
  <li><a class="underlined" href="cuda.xhtml">CUDA</a></li>
  <li><a class="underlined" href="aarch64.xhtml">AArch64</a> - Advanced SIMD</li>
</ul>

<div><br/></div>

<p>
  The supported combinations of the architecture, operating system and
  compiler are shown in Table 1.1.
</p>

<div style="margin-top: 1.0cm;"></div>

<table style="text-align:center;" align="center">
  <tr align="center">
    <td class="caption">Table 1.1: Environment support matrix</td>
  </tr>
  <tr align="center">
    <td>
      <table class="lt">
        <tr>
          <td class="lt-hl"></td>
	  <td class="lt-hl"></td>
          <td class="lt-hl"></td>
          <td class="lt-hl"></td>
          <td class="lt-hl"></td>
        </tr>
	<tr>
	  <td class="lt-br"></td>
	  <td class="lt-hl"></td>
	  <td class="lt-blr" align="center">GCC</td>
	  <td class="lt-br" align="center">Clang</td>
	  <td class="lt-b" align="center">MSVC</td>
	</tr>
        <tr>
          <td class="lt-hl"></td>
	  <td class="lt-hl"></td>
	  <td class="lt-hl"></td>
          <td class="lt-hl"></td>
          <td class="lt-hl"></td>
        </tr>
	<tr>
	  <td class="lt-r" align="left">x86_64, Linux</td>
	  <td></td>
	  <td class="lt-lr" align="center">Supported</td>
	  <td class="lt-r" align="center">Experimental</td>
	  <td class="lt-" align="center">N/A</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">x86_64, Windows</td>
	  <td></td>
	  <td class="lt-lr" align="center">Experimental(Cygwin)</td>
	  <td class="lt-r" align="center">Experimental</td>
	  <td class="lt-" align="center">Supported</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">RISC-V (64-bit), Linux</td>
	  <td></td>
	  <td class="lt-lr" align="center">Supported</td>
	  <td class="lt-r" align="center">Experimental</td>
	  <td class="lt-" align="center">N/A</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">PowerPC (64 bit), Linux</td>
	  <td></td>
	  <td class="lt-lr" align="center">Supported</td>
	  <td class="lt-r" align="center">Experimental</td>
	  <td class="lt-" align="center">N/A</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">System/390 (64 bit), Linux</td>
	  <td></td>
	  <td class="lt-lr" align="center">Supported</td>
	  <td class="lt-r" align="center">Experimental</td>
	  <td class="lt-" align="center">N/A</td>
	</tr>
	<tr>
	  <td class="lt-r" align="left">AArch64, Linux</td>
	  <td></td>
	  <td class="lt-lr" align="center">Supported</td>
	  <td class="lt-r" align="center">Experimental</td>
	  <td class="lt-" align="center">N/A</td>
	</tr>
	<tr>
	  <td class="lt-br" align="left">AArch64, macOS</td>
	  <td class="lt-hl"></td>
	  <td class="lt-blr" align="center">Experimental</td>
	  <td class="lt-br" align="center">Supported</td>
	  <td class="lt-b" align="center">N/A</td>
	</tr>
      </table>
    </td>
  </tr>
</table>

<div style="margin-top: 2.0cm;"></div>

<p>
  Supported compilers are only the latest versions of compilers
  officially used on the OSes. All functions in the library are thread
  safe unless otherwise noted.
</p>
  

<h2 id="credit">Credit</h2>

<ul class="disc">
  <li>The main developer is <a class="underlined"
  href="https://github.com/shibatch">Naoki Shibata</a>
  ( <a href="mailto:shibatch@users.sourceforge.net">shibatch@users.sourceforge.net</a> ).</li>
  <li><a class="underlined"
  href="https://github.com/shibatch/sleef/graphs/contributors">
  And many more contributors you can find listed on GitHub.</a></li>
</ul>

<h2 id="license">License</h2>

<p class="noindent">
SLEEF is distributed under <a class="underlined"
href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License
Version 1.0</a>. Contributions to this project are accepted under the
same license.
</p>

<br/>

<p class="noindent">
SLEEF project aims to serve society as a whole, not just specific
companies or organizations. We charge a fee for maintaining patches
that are convenient only for your company.
</p>

<br/>

<p class="noindent">
The fact that our software is released under an open source license
only means that you can use the current and older versions of the
software for free. If you want us to continue maintaining our
software, you need to financially support our project. Please see
our <a class="underlined"
href="https://github.com/shibatch/nofreelunch?tab=coc-ov-file">Code of
Conduct</a> or its <a class="underlined"
href="https://youtu.be/35zFfdCuBII">introduction
video</a>.
</p>

<br/>

<p class="noindent" style="margin-top: 0.8cm;">
  <a class="nothing" href="https://opensource.org/">
    <img src="osi_logo.png" width="90" height="103" alt="open source logo" style="position:relative; top:3px;"/>
  </a>
&nbsp; Boost Software License is <a class="underlined"
href="https://opensource.org/licenses/BSL-1.0">OSI-certified</a>.
See <a class="underlined"
href="http://www.boost.org/users/license.html">this page</a> for more
information about Boost Software License.
</p>


<h2 id="history">History</h2>

<p class="noindent" style="margin-top: 1.0cm;">
See <a class="underlined"
href="https://github.com/shibatch/sleef/blob/master/CHANGELOG.adoc">Changelog</a>
for a full history of changes to SLEEF.</p>


<h2 id="publication">Publication</h2>

<ul class="disc">
  <li>Naoki Shibata and Francesco Petrogalli : <B>SLEEF: A Portable Vectorized Library of C Standard Mathematical Functions,</B> <I>in IEEE Transactions on Parallel and Distributed Systems,</I> <a class="underlined" href="https://doi.org/10.1109/TPDS.2019.2960333">DOI:10.1109/TPDS.2019.2960333</a> (Dec. 2019). [<a class="underlined" href="https://arxiv.org/pdf/2001.09258">PDF</a>]</li>
</ul>

<p class="footer">
  Copyright &copy; 2010-2025 SLEEF Project, Naoki Shibata and contributors.<br/>
  SLEEF is open-source software and is distributed under the Boost Software License, Version 1.0.
</p>

<script type="text/javascript">
var sc_project=13098265; 
var sc_invisible=1; 
var sc_security="518de45e"; 
</script>
<script type="text/javascript"
src="https://www.statcounter.com/counter/counter.js"
async="async"></script>
<noscript><div class="statcounter"><a title="Web Analytics"
href="https://statcounter.com/" target="_blank"><img
class="statcounter"
src="https://c.statcounter.com/13098265/0/518de45e/1/"
alt="Web Analytics"
referrerPolicy="no-referrer-when-downgrade"></img></a></div></noscript>


</body>
</html>
